package com.ssy.lingxi.platform.manage.repository;

import com.ssy.lingxi.platform.manage.entity.content.ContentAdvert;
import com.ssy.lingxi.platform.manage.entity.content.MemberAdvert;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author hsl
 * @version 2.0.0
 * @date 22/03/11 11:19
 */
@Repository
public interface MemberAdvertRepository extends JpaRepository<MemberAdvert, Long>, JpaSpecificationExecutor<MemberAdvert> {

    boolean existsBySortAndColumnTypeAndCreateMemberIdAndCreateMemberRoleId(Integer sort, Integer columnType,Long createMemberId, Long createMemberRoleId);

    MemberAdvert findBySortAndColumnTypeAndCreateMemberIdAndCreateMemberRoleId(Integer sort, Integer columnType, Long memberId, Long memberRoleId);

    List<MemberAdvert> findAllByStatusAndColumnTypeAndCreateMemberIdAndCreateMemberRoleId(int status, Integer columnType, Long createMemberId, Long createMemberRoleId,Sort sort);
}
